<?php
$file = 'file';
$filename = time().substr($_FILES[$file]['name'], strrpos($_FILES[$file]['name'],'.'));

$response = array();

if(move_uploaded_file($_FILES[$file]['tmp_name'], $filename)){
    $response['isSuccess'] = true;
    $response[$file] = '/' . $filename;
}else{
    $response['isSuccess'] = false;
}

echo json_encode($response);
?>